package com.jycj.java.study;

public class Student {

    //编写类的基本属性 成员变量
    private int id;

    private String name;

    private double score;
 
    //重载打招呼的方式  成员方法
    public void say() {
        System.out.println("你好!");
    }

    public void say(int id) {
        System.out.println("你好，我的id是:" + id);
    }

    public void say(int id, String name) {
        System.out.println("你好,我的id是:" + id + ",我的名字是:" + name);
    }

    public void say(int id, String name, double score) {
        System.out.println("你好,我的id是:" + id + ",我的名字是:" + name + ",我要考的分数是:" + score);
    }

    //构造函数
    public Student() {
        say();
    }

    //多个参数的构造
    public Student(int id, String name, double score) {
        this.id = id;
        this.name = name;
        this.score = score;
        say(this.id,this.name,this.score);
    }


    public static void main(String[] args) {
        //赋值
        Student student1 = new Student();
        Student student2 = new Student(2,"ergou",101.8);
        Student student3 = new Student(3,"ergou",101.8);

    }
}
